<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>自助接单</title>
		<!--标准mui.css，公共样式-->
		<link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
		<link rel="stylesheet" type="text/css" href="../css/iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="../css/public.css"/>
		<link rel="stylesheet" type="text/css" href="../css/self_help_order.css"/>
	</head>

	<body>
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left color6"></a>
			<h1 class="mui-title color6">
				<div class="mui-input-row">
				    <input type="search" placeholder="老司机代驾">
					<a class="iconfont mui-icon icon-shuaxin" id="refresh"></a>
				</div>
			</h1>
		</header>
		<div class="mui-content">
			<div class="mui-text-center p_tb20">
				<h4 class="p_tb10">附近有<span class="color_orange font20">2</span>位司机随时接驾</h4>	
				<p>最近司机距您<span class="color_orange">265米</span></p>
			</div>
			<form class="mui-input-group">
			    <div class="mui-input-row b_b1">
			        <label class="m_r10"><span class="iconfont mui-icon font22 colorP">&#xe603;</span></label>
			        <input type="text" class="mui-input-clear mui-pull-left" id="initial_position" placeholder="请输入上车地址" value="">
			    </div>
			    <div class="mui-input-row">
			        <label class="m_r10"><span class="iconfont mui-icon font22 color_orange">&#xe67d;</span></label>
			        <input type="number" class="" id="phone_num" placeholder="请输入手机号" value="">
			    	<span class="mui-badge mui-btn-grey mui-pull-right b_r8 p_tb10 p_lr10 mui-hidden">此号码为新用户</span>
			    </div>
			</form>
			<div class="w80 m_lr10 m_t60">
				<button type="button" class="mui-btn mui-btn-green bg_green btn-green w100 p_tb11_lr15 font16 bg_P b_r8" id="call_driver">呼叫司机</button>
				<div class="mui-input-row mui-checkbox mui-left p_n m_t10">
				  <label class="color9 font12">已阅读并同意用户协议</label>
				  <input name="checkbox1" type="checkbox" checked>
				</div>
			</div>
			<ul class="m_lr10 m_t40">
				<li class="font16 m_b10">客服电话：<a class="colorP">400</a></li>
				<li class=" m_b6">APP下载：</li>
				<li class="font12 m_l76 m_b6">用户端：<a href="Download.html" class="colorP">www.laosiji.com</a></li>
				<li class="font12 m_l76 m_b6">用户端：<a href="Download.html" class="colorP">www.laosiji.com</a></li>
			</ul>
		</div>
	</body>
	<!-- Mui core JavaScript-->
	<script type="text/javascript" src="../js/mui.min.js"></script>
	<script type="text/javascript" src="../js/appconfig.js"></script>
	<script type="text/javascript" src="../js/jquery-2.2.4.min.js"></script>
	<script src="../js/public.js"></script>
	<script type="text/javascript">
		document.addEventListener( "plusready", onPlusReady, false );
		// 扩展API加载完毕，现在可以正常调用扩展API
		function onPlusReady() {
			plus.geolocation.getCurrentPosition( function ( p ) {
				$('#initial_position').val(p.address.poiName);
			}, function ( e ) {
			//	alert( "Geolocation error: " + e.message );
			} );
		}
		
		//判断起始位置是否有值
		$('#initial_position').on('blur',function(){
			if($(this).val() == ""){
				mui.toast('请输入起始位置');return;
			} else {
				//判断起始位置和电话号码都没有值
				if($('#initial_position').val() !="" && $('#phone_num').val()!=""){
					$('#call_driver').attr('disabled',false);
				}
			}
		})
		
		//判断电话号码格式和
		$('#phone_num').on('blur',function(){
			if($(this).val() == ""){
				mui.toast('请输入电话号码');return;
			}else{
				if(!phone_num.test($(this).val())){
					mui.toast('请输入正确的手机号');return;
				} else {
					if($('#initial_position').val() !="" && $('#phone_num').val()!=""){
						$('#call_driver').attr('disabled',false);
					}
				}
			}
		})
		//呼叫司机
//		$('#call_driver').on('tap',function(){
//			plus.device.dial($('#phone_num').val(),true);
//		})
	</script>
</html>